package com.firebird.app.kotlin.stock.ui.godeal.tab.tab_choose

import android.R
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.view.View
import butterknife.BindView
import butterknife.Unbinder
import com.firebird.app.kotlin.stock.base.BaseMvpFragment
import com.zabra.zl.R
import com.zabra.zl.base.BaseMvpFragment
import com.zabra.zl.ui.godeal.tab.tab_choose.contract.TabChooseContract
import com.zabra.zl.ui.godeal.tab.tab_choose.presenter.TabChoosePresenter
import java.util.*


class TabChoose : BaseMvpFragment<TabChoosePresenter?>(), TabChooseContract.View {
    @BindView(R.id.recycler)
    var recycler: RecyclerView? = null
    var unbinder: Unbinder? = null
    private val list: MutableList<String?> = ArrayList()
    private var adp: Adp? = null
    override fun initView(view: View?) {
        list.add("荣安地产")
        list.add("荣安地产")
        list.add("荣安地产")
        list.add("荣安地产")
        recycler.setLayoutManager(LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false))
        //        recycler.setNestedScrollingEnabled(false);
        adp = Adp(R.layout.item_choose, list)
        recycler.setAdapter(adp)
        adp!!.openLoadAnimation()
        adp!!.setOnItemChildClickListener { adapter, view, position ->
            list.removeAt(position)
            adp.notifyItemRemoved(position)
        }
    }

    override val layoutId: Int
        protected get() = R.layout.tab_choose

    override fun showLoading() {}
    override fun hideLoading() {}
    override fun onError(throwable: Throwable?) {}
}